home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- #ifndef _WPRTDLG_HPP_INCLUDED
- #define _WPRTDLG_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCANVAS_HPP_INCLUDED
- # include "wcanvas.hpp"
- #endif
- #ifndef _WCOMDLG_HPP_INCLUDED
- # include "wcomdlg.hpp"
- #endif
- #ifndef _WPRTDATA_HPP_INCLUDED
- # include "wprtdata.hpp"
- #endif
-
- #undef GetPrinterData
- #undef SetPrinterData
- #if defined( _UNICODE )
- #define GetPrinterData GetPrinterDataW
- #define SetPrinterData SetPrinterDataW
- #else
- #define GetPrinterData GetPrinterDataA
- #define SetPrinterData SetPrinterDataA
- #endif
-
- //
- // PrintDialog Styles
- //
-
- typedef WULong WPrintDStyle;
-
- #define WPrintDSAllPages ((WPrintDStyle)0x00000000L)
- #define WPrintDSSelection ((WPrintDStyle)0x00000001L)
- #define WPrintDSPageNums ((WPrintDStyle)0x00000002L)
- #define WPrintDSNoSelection ((WPrintDStyle)0x00000004L)
- #define WPrintDSNoPageNums ((WPrintDStyle)0x00000008L)
- #define WPrintDSCollate ((WPrintDStyle)0x00000010L)
- #define WPrintDSPrintToFile ((WPrintDStyle)0x00000020L)
- #define WPrintDSPrintSetup ((WPrintDStyle)0x00000040L)
- #define WPrintDSNoWarning ((WPrintDStyle)0x00000080L)
- #define WPrintDSReturnDC ((WPrintDStyle)0x00000100L)
- #define WPrintDSReturnIC ((WPrintDStyle)0x00000200L)
- #define WPrintDSReturnDefault ((WPrintDStyle)0x00000400L)
- #define WPrintDSShowHelp ((WPrintDStyle)0x00000800L)
- #define WPrintDSEnablePrintHook ((WPrintDStyle)0x00001000L)
- #define WPrintDSEnablePrintTemplate ((WPrintDStyle)0x00004000L)
- #define WPrintDSUseDevModeCopies ((WPrintDStyle)0x00040000L)
- #define WPrintDSUseDevModeCopiesAndCollate ((WPrintDStyle)0x00040000L)
- #define WPrintDSDisablePrintToFile ((WPrintDStyle)0x00080000L)
- #define WPrintDSHidePrintToFile ((WPrintDStyle)0x00100000L)
- #define WPrintDSNoNetworkButton ((WPrintDStyle)0x00200000L)
-
- //
- // WPrintDialog
- //
- // Used to display color dialog.
-
- class WCMCLASS WPrintDialog : public WCommonDialog {
- WDeclareSubclass( WPrintDialog, WCommonDialog );
-
- public:
- WPrintDialog();
-
- ~WPrintDialog();
-
- /*******************************************************
- * Properties
- *******************************************************/
-
- // Copies
-
- WUShort GetCopies() const;
- WBool SetCopies( WUShort numCopies );
-
- // Collate
- //
- //
- WBool GetCollate() const;
- WBool SetCollate( WBool bCollate=FALSE);
-
- // FirstPage
-
- WUShort GetFirstPage() const;
- WBool SetFirstPage( WUShort firstPage );
-
- // FromPage
-
- WUShort GetFromPage() const;
- WBool SetFromPage( WUShort fromPage );
-
- // InfoCanvas
-
- WInfoCanvas GetInfoCanvas() const;
-
- // LastPage
-
- WUShort GetLastPage() const;
- WBool SetLastPage( WUShort lastPage );
-
- // PrinterData
- //
- // The data that defines which printer is chosen and
- // its currennt settings (landscape, etc.). A copy is made
- // when setting.
-
- WPrinterData GetPrinterData() const;
- WBool SetPrinterData( const WPrinterData & pd );
-
- // PrinterCanvas
-
- WPrinterCanvas GetPrinterCanvas() const;
-
- // SoftwareCollate
- //
- // This property is TRUE if the application software
- // should perform the collation (the printer does not
- // support collating, so it must be emulated in software)
-
- WBool GetSoftwareCollate() const;
-
- // SoftwareCopies
- //
- // This property returns the number of copies that the
- // application software should print. It will be '1' if
- // the printer supports the collating / copies selected,
- // otherwise it will be the number of copies that the
- // application software must print. In all cases, the
- // number entered by the user in the dialog is available
- // through GetCopies(), and the number of copies that should
- // be printed by your code is in GetSoftwareCopies().
-
- WUInt GetSoftwareCopies() const;
-
- // Style
- //
- // Set the styles used by the print dialog. Note that
- // the WPrintDSEnableHook style will ALWAYS be enabled.
-
- WPrintDStyle GetStyle() const;
- WBool SetStyle( WPrintDStyle style );
-
- // ToPage
-
- WUShort GetToPage() const;
- WBool SetToPage( WUShort toPage );
-
- /*******************************************************
- * Methods
- *******************************************************/
-
- // ChangeStyle
- //
- // Use to turn a specific style on or off.
-
- WBool ChangeStyle( WPrintDStyle style, WBool on );
-
- // Prompt
- //
- // Display the dialog and wait for it to be dismissed.
- // The first form uses the current settings. The second
- // is a convenience function.
-
- WBool Prompt();
-
- WBool Prompt( WWindow *owner, const WChar *title );
-
- /************************************************************
- * Notifications
- ************************************************************/
-
- void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
-
- protected:
-
- virtual void *PackPD();
- virtual WBool UnpackPD( WBool ok );
-
- protected:
-
- void *_pd;
- WBool _softwareCollate;
- WUInt _softwareCopies;
- WPrinterCanvas _printerCanvas;
- WInfoCanvas _infoCanvas;
- WPrinterData _printerData;
- };
-
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WPRTDLG_HPP_INCLUDED
-